//
//  LKUserInforTool.m
//  LKIntelligentVideoProject
//
//  Created by she1323 on 2018/11/8.
//  Copyright © 2018年 she1323. All rights reserved.
//

#import "LKUserInforTool.h"

#define LKAccountPath [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"account.archive"]


@implementation LKUserInforTool


+ (void)saveAccount:(LKUserInfor *)account
{
    [NSKeyedArchiver archiveRootObject:account toFile:LKAccountPath];
}

+ (LKUserInfor *)account
{
    @try {
        return [NSKeyedUnarchiver unarchiveObjectWithFile:LKAccountPath];
    } @catch (NSException *exception) {
        return nil;
    } @finally {
        
    }
}

+ (void)noAccount
{
    NSFileManager *manager = [NSFileManager defaultManager];
    [manager removeItemAtPath:LKAccountPath error:nil];
}

+(void)reloadUserInformation{
    
}


@end
